/*
*   Copyright: Fabian Hajek (2012)  Programmieren: C   -   Semesterarbeit WS 2011/2012
*
*   Projekt: Schreinerei.exe
*
*   Author: $Author: webmaster@die-schwarzen-schwaben.de $
*
*   Name: log.c
*   URL:    $URL: http://semesterarbeit-wi-11-12.googlecode.com/svn/trunk/Semesterarbeit2/Schreinerei/output/log.c $
*
*   Description:   Gibt TEXT in das LOG-file aus
*
*   Last update:    $Date: 2012-02-24 21:45:10 +0000 (Fri, 24 Feb 2012) $
*
*   Rev:      $Rev: 56 $
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>


/*INCLUDE input functions*/
#include "../default/structures.h"
#include "../Definitionen/define.h"
#include "log.h"

void log(char value[],float f_value,int i)
{

    //Oeffne FILE, falls keines existiert, erstellen.
    FILE *pF;
    pF = fopen("log.file","a");
    if(!i) pF = fopen("log.file","w");

    if(f_value)
    {
        fprintf(pF,"%.2f",f_value);
        fclose(pF);
    }
    else
    {
        fprintf(pF,"%s",value);
        fclose(pF);
    }

}
